import 'package:flutter/material.dart';
import 'package:scan/scan.dart';

class ScanCode extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => ScanCodeState();
}

class ScanCodeState extends State<ScanCode> {

  ScanController scanController = ScanController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        child: ScanView(
          controller: scanController,
          scanAreaScale: .7,
          scanLineColor: Colors.green.shade400,
          onCapture: (data) {
            print(data);
            // use data do something
          },
        ),
      ),
    );
  }
}
